package chixing.day06.homework;

/**
 * 属性：orderId（订单编号）、amount（金额）
 * 构造函数：初始化属性
 * 方法：printOrder()，打印订单编号和金额
 */
public class Order {
    private int orderId;
    private double amount;

    public Order(){}
    public Order(int orderId, double amount) {
        this.orderId = orderId;
        this.amount = amount;
    }

    /**
     * 打印订单编号和金额
     */
    public void printOrder(){
        System.out.println(
                "订单编号:" + orderId + "订单金额:" + amount
        );
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", amount=" + amount +
                '}';
    }
}
